import request, {
	uploadIcon
} from "./request.js"

export const api = {
	Login: '/user/login',
	UserEntities: '/user/getList',
	UserSingle: '/user/querySingle',
	LogOut: '/user/logout',
	// 更新签名
	UploadSign: '/user/uploadSign',
	// 项目列表
	ProjectEntities: '/project/queryList',
	// 项目详情
	ProjectSingle: '/project/querySingle',
	SaveProject: '/project/saveSingle',
	UpdateProject: '/project/updateSingle',
	DeleteProject: '/project/deleteSingle',
	MyProjectList: '/project/myQueryList', // 我的项目
	SaveProjectUser: '/projectUser/saveSingle', // 授权项目指定人员
	ProjectUserList: '/projectUser/queryList',
	// 设备列表
	//DeviceList: '/device/queryList',
	// 设备列表
	DeviceEntities: '/device/queryList',
	// 设备详情
	DeviceSingle: '/device/querySingle',
	// 保存设备
	SaveDevice: '/device/saveSingle',
	// 修改设备
	UpdateDevice: '/device/updateSingle',
	// 删除设备
	DeleteDevice: '/device/deleteSingle',
	// 设备类型
	DeviceTypeEntities: '/deviceType/queryList',
	SaveDeviceType: '/deviceType/saveSingle',
	DeviceTypeSingle: '/deviceType/querySingle',
	// 零部件类型
	PartTypeEntities: '/partType/queryList',
	// 保存零部件类型
	SavePartType: '/partType/saveSingle',
	// 零部件列表
	PartEntities: '/part/queryList',
	// 保存零部件
	SavePart: '/part/saveSingle',
	// 修改零部件
	UpdatePart: '/part/updateSingle',
	// 查询零部件详情
	PartSingle: '/part/querySingle',
	// 项目文件列表
	ProjectDataEntities: '/projectData/queryList',
	// 当前目录的上级所有目录
	QueryParentList: '/projectData/queryParentList',
	// 项目文件详情
	ProjectDataSingle: '/projectData/querySingle',
	// 创建项目文件夹
	CreateFolder: '/projectData/createFolder',
	// 修改项目文件夹
	UpdateFolder: '/projectData/updateFolder',
	// 上传项目资料
	UploadProjectData: '/projectData/updateFile',
	// 支付申请列表
	PayEntities: '/pay/queryList',
	// 支付申请详情
	PaySingle: '/pay/querySingle',
	SavePay: '/pay/saveSingle',
	UpdatePay: '/pay/updateSingle',
	DeletePay: '/pay/deleteSingle',
	// 支付申请审批
	ApprovePay: '/pay/approvePay',
	// 合同列表
	ContractEntities: '/contract/queryList',
	GetContractEntities: '/contract/getList',
	// 合同审批
	ApproveContract: '/contract/approveContract',
	// 保存合同
	SaveContract: '/contract/saveSingle',
	ContractSingle: '/contract/querySingle',
	DeleteContract: '/contract/deleteSingle',
	UpdateContract: '/contract/updateSingle',
	// 合同总涉及金额描述
	TotalMoney: '/contract/queryTotalMoney',
	// 合同详情
	ContractSingle: '/contract/querySingle',
	// 报价列表
	QuoteEntities: '/quote/queryList',
	// 报价详情
	QuoteSingle: '/quote/querySingle',
	// 保存报价
	SaveQuote: '/quote/saveSingle',
	ApproveQuote: '/quote/approveQuote',
	// 附件清单
	AnnexEntities: '/file/queryList',
	// 审批记录
	ApproveEntities: '/approveRecord/queryList',
	// 报销列表
	ExpenseEntities: '/expenseAccount/queryList',
	// 查询报销详情
	ExpenseSingle: '/expenseAccount/queryExpenseAccount',
	// 保存报销
	SaveExpense: '/expenseAccount/saveSingle',
	// 编辑报销
	UpdateExpense: '/expenseAccount/updateSingle',
	// 报销审批
	ApproveExpense: '/expenseAccount/approveExpense',
	// 删除报销
	DeleteExpenseAccount: '/expenseAccount/deleteSingle',
	// 出差人员
	OutWorkList: '/outWork/queryList',
	SaveOutWork: '/outWork/saveSingle',
	// 删除报销人
	DeleteOutWork: '/outWork/deleteSingle',
	// 查询一个文件详情
	FileSingle: '/file/querySingle',
	// 企业列表
	PartnerEntities: '/partner/queryList',
	// 上传文件
	SaveFile: '/file/saveSingle',
	// 设备类别列表
	GetDeviceTypeEntities: '/deviceType/getList',
	// 零部件类型列表
	GetPartTypeEntities: '/partType/getList',
	// 零部件类型详情
	PartTypeSingle: '/partType/querySingle',
	// 保存采购清单
	SaveProcureSingle: '/procureList/saveSingle',
	ProcureListSingle: '/procureList/querySingle',
	UpdateProcureList: '/procureList/updateSingle',
	DeleteProcureList: '/procureList/deleteSingle',
	// 采购清单列表
	ProcureListEntities: '/procureList/queryList',
	// 供应商/业主详情
	PartnerSingle: '/partner/querySingle',
	// 数据看板：项目状态
	ProjectStatus: '/dashboard/projectStatus',
	// 数据看板：销售额
	SaleAmountEntities: '/dashboard/sales',
	// 数据看板：采购合同
	ProcureContract: '/dashboard/procureContract',
	// 数据看板：待办提醒
	ReminderEntities: '/dashboard/reminder',
}


/**
 * 统一封装访问接口
 * @param {Object} url
 * @param {Object} param
 */
export function post(url, param) {
	return request(url, 'POST', param)
}

/**
 * 
 * @param {*} url 
 * @param {*} formData : 封装的上传数据
 */
export function upload(url, filePath, formData) {
	console.log(formData)
	return uploadIcon(url, filePath, formData)
}


export let ConstUtil = {

	/**
	 * 文件类型
	 */
	BUSINESS_PROCURE_CONTRACT_INFO: 1, // 采购合同业务模块
	BUSINESS_SALE_CONTRACT_INFO: 2, // 销售合同业务模块
	BUSINESS_EXPENSE_INFO: 3, // 报销业务
	BUSINESS_PARTNER_INFO: 4, // 客户业务
	BUSINESS_QUOTE_INFO: 5, // 报价业务


	FILE_TYPE_CONTRACT: 1, // 合同文件
	FILE_TYPE_INVOICE: 2, // 发票文件
	FILE_TYPE_RECEIPT: 3, // 收据文件
	FILE_TYPE_LICENSE: 4, // 营业执照文件


	/******************************************
	 *
	 * 后端返回的结果魔法
	 *
	 ******************************************/
	SUCCESS: '000000', //执行成功

	ERROR: '999999', // ( "999999", "系统错误" );
}